__author__ = 'Robin'
import re,os
from datiandou import settings
PROJECT_PATH = os.path.join(os.path.split(os.path.dirname(__file__))[0], '').replace('\\','/')

arg = "%Y-%M-%d %I:%M %p as my_current_time"
m = re.search(r'(.*?) as (\w+)', arg)
if m:
    fmt, var_name = m.groups()
    print(fmt)
full_name = '%s %s' % ("xxx", "yyy")
default = lambda:{"email": "to1@example.com"}
print(PROJECT_PATH)
print(os.path.dirname(__file__))
import io

f = open(r'C:\Users\IBM_ADMIN\Desktop\table\table\ad\BI_BUSI_AVAIBLE_struct.log', 'r+')
tables=str(f.readlines())
m2=re.search(r'(----\s.*)(\s.*SQL)', tables)
if m2:
    fmt = m2.groups()
    subs=str(fmt[0])
    cols=re.search(r'(\s?\w*\t*)(\s+)(.*\s)',subs)
    if cols:
        print(cols.groups()[0])
        print(cols.groups()[1])
        print(cols.groups()[2])

print(tables[350:])
for line in f:
    if str(line).format("SQL>"):
        print(line)

